DIV

Syntax: x DIV y         (QL ROM)
        DIV (x,y)       (Math Package)
Location: QL ROM, Math Package

The DIV returns the integer part of x divided by y. If x or y is not an integer, then the given value is rounded to the nearest integer (compare INT).

The result of the operation is always rounded down to the next integer ie. x DIV y=INT(x/y).  Although this leads to some unexpected results with negative numbe is so that the formula:

x=y*(x DIV y)+(x MOD y)

is always true

The Math Package version is defined as a function, eg. PRINT DIV(3,2) gives 1.

Example:
PRINT 13 DIV 5
gives the result 2 (13 divided by 5 is 2.6)

PRINT -13 DIV 5
gives the result -3

CROSS-REFERENCE:
MOD returns the modulus of x divided by y.
